package com.example.demo.api;

public enum ResultCode implements ErrorCode {

    //操作成功
    U_LOGIN_SUCCESS(200, "登录成功"),
    A_LOGIN_SUCCESS(201, "管理员登录成功"),
    LOGOUT_SUCCESS(200, "退出登录成功"),
    REGISTER_SUCCESS(200, "注册成功"),
    CANCEL_SUCCESS(200, "注销成功"),
    POST_INFO_SUCCESS(200, "发布消息成功"),
    GET_INFO_SUCCESS(200, "查看消息成功"),
    DELETE_INFO_SUCCESS(200, "删除消息成功"),
    PUT_INFO_SUCCESS(200, "修改消息成功"),
    BAN_USER_SUCCESS(200, "封禁用户成功"),
    UNBAN_USER_SUCCESS(200, "解封用户成功"),
    PICTURE_SUCCESS(200, "图片传输成功"),
    REPORT_SUCCESS(200, "举报成功"),



    //操作失败
    REGISTER_USER_FAILED(500, "该用户已注册"),
    REGISTER_FAILED(500, "注册失败"),
    USERNAME_FAILED(500, "该用户不存在"),
    PASSWORD_FAILED(500, "密码错误"),
    BANNED_FAILED(500, "该用户被封禁"),
    LOGIN_FAILED(500, "登录失败"),
    CANCEL_FAILED(500, "注销失败"),
    LOGOUT_FAILED(500, "退出登录失败"),
    TOKEN_FAILED(500, "非法用户"),
    POST_INFO_FAILED(500, "发布信息失败"),
    GET_INFO_FAILED(500, "查看信息失败"),
    DELETE_INFO_FAILED(500, "删除信息失败"),
    PUT_INFO_FAILED(500, "修改信息失败"),
    Admin_FAILED(500, "无管理员权限"),
    BAN_USER_FAILED(500, "封禁用户失败"),
    UNBAN_USER_FAILED(500, "解封用户失败"),
    PICTURE_FAILED(500, "图片传输失败"),
    REPORT_FAILED(500, "举报失败"),
    ADMIN_FAILED(500, "非本人信息"),



    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限");
    private long code;
    private String message;

    private ResultCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    public long getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
